package com.emily.test.model;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * application.yml管理spring中的属性类
 */
@Component
@ConfigurationProperties(prefix = "spring")
public class SpringConfigurationValue {
    private Map<String,Object> application=new HashMap<String,Object>();
    private Map<String,Object> redis=new HashMap<String,Object>();
    private Map<String,Object> datasource=new HashMap<String,Object>();
    private Map<String,Object> session=new HashMap<String,Object>();

    public void setApplication(Map<String, Object> application) {
        this.application = application;
    }

    @Override
    public String toString() {
        return "SpringConfigurationValue{" +
                "redis=" + redis +
                '}';
    }

    public Map<String, Object> getRedis() {
        return redis;
    }

    public void setRedis(Map<String, Object> redis) {
        this.redis = redis;
    }

    public Map<String, Object> getDatasource() {
        return datasource;
    }

    public void setDatasource(Map<String, Object> datasource) {
        this.datasource = datasource;
    }

    public Map<String, Object> getSession() {
        return session;
    }

    public void setSession(Map<String, Object> session) {
        this.session = session;
    }

    public Map<String, Object> getApplication() {
        return application;
    }
}
